package com.distributer.message.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Random;

public class Message  implements Serializable {
	
    private static final long serialVersionUID = 1L;

    /**
    * message_id
    */
    private Integer messageId;

    /**
    * 消息编号
    */
    private String messageNo;

    /**
    * 消息序列号
    */
    private String messageSquece;

    /**
    * 通知方式
    */
    private Integer notifyWay;

    /**
    * 通知主题
    */
    private String notifyTopic;

    /**
    * 通知数据类型
    */
    private Integer notifyDataType;

    /**
    * 通知数据
    */
    private String notifyData;

    /**
    * 最大重试次数
    */
    private Integer retryMaxCount;

    /**
    * 重试次数
    */
    private Integer retryCount;

    /**
    * 下次重试时间
    */
    private Date nextRetryTime;

    /**
    * 通知状态
    */
    private Integer notifyStatus;

    /**
    * 是否死亡
    */
    private Integer isDead;

    /**
    * 确认次数
    */
    private Integer confirmCount;

    /**
    * 消息确认地址
    */
    private String confirmReqUrl;

    /**
    * 失败备注
    */
    private String failRemark;

    /**
    * 创建时间
    */
    private Date createTime;

    /**
    * 更新时间
    */
    private Date updateTime;

    private static final Random RANDOM = new Random();
    
    public Message() {
    	this.messageSquece = ""+System.currentTimeMillis()+RANDOM.nextInt(4);
    	this.createTime = new Date();
    	this.updateTime = new Date();
    	this.isDead = 0;
    	this.notifyStatus = 10;
    	this.retryCount = 0;
    	this.notifyWay = 10;
    	this.notifyDataType = 10;
    	this.nextRetryTime = new Date();
    	this.retryMaxCount = 3;
    }

	public Integer getMessageId() {
		return messageId;
	}

	public void setMessageId(Integer messageId) {
		this.messageId = messageId;
	}

	public String getMessageNo() {
		return messageNo;
	}

	public void setMessageNo(String messageNo) {
		this.messageNo = messageNo;
	}

	public String getMessageSquece() {
		return messageSquece;
	}

	public void setMessageSquece(String messageSquece) {
		this.messageSquece = messageSquece;
	}

	public Integer getNotifyWay() {
		return notifyWay;
	}

	public void setNotifyWay(Integer notifyWay) {
		this.notifyWay = notifyWay;
	}

	public String getNotifyTopic() {
		return notifyTopic;
	}

	public void setNotifyTopic(String notifyTopic) {
		this.notifyTopic = notifyTopic;
	}

	public Integer getNotifyDataType() {
		return notifyDataType;
	}

	public void setNotifyDataType(Integer notifyDataType) {
		this.notifyDataType = notifyDataType;
	}

	public String getNotifyData() {
		return notifyData;
	}

	public void setNotifyData(String notifyData) {
		this.notifyData = notifyData;
	}

	public Integer getRetryMaxCount() {
		return retryMaxCount;
	}

	public void setRetryMaxCount(Integer retryMaxCount) {
		this.retryMaxCount = retryMaxCount;
	}

	public Integer getRetryCount() {
		return retryCount;
	}

	public void setRetryCount(Integer retryCount) {
		this.retryCount = retryCount;
	}

	public Date getNextRetryTime() {
		return nextRetryTime;
	}

	public void setNextRetryTime(Date nextRetryTime) {
		this.nextRetryTime = nextRetryTime;
	}

	public Integer getNotifyStatus() {
		return notifyStatus;
	}

	public void setNotifyStatus(Integer notifyStatus) {
		this.notifyStatus = notifyStatus;
	}

	public Integer getIsDead() {
		return isDead;
	}

	public void setIsDead(Integer isDead) {
		this.isDead = isDead;
	}

	public Integer getConfirmCount() {
		return confirmCount;
	}

	public void setConfirmCount(Integer confirmCount) {
		this.confirmCount = confirmCount;
	}

	public String getConfirmReqUrl() {
		return confirmReqUrl;
	}

	public void setConfirmReqUrl(String confirmReqUrl) {
		this.confirmReqUrl = confirmReqUrl;
	}

	public String getFailRemark() {
		return failRemark;
	}

	public void setFailRemark(String failRemark) {
		this.failRemark = failRemark;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	
}
